{include file="public/header" /}
<style type="text/css">
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0px;
        margin-top: 0px
    }

    #title span {
        float: right;
    }

    .btn-active {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">

                <div style="display:block;clear: both;"></div>
                <div class="fixed-table-toolbar">
                    <a class="btn btn-default btn-outline {if input('get.field/s') eq ''} btn-active{/if}" href="{:url('package/buyLogList')}">所有</a>
                    {volist name="states" id="v" }
                    <a class="btn btn-default btn-outline {if input('get.field/s') eq 'state' && input('get.value/s') eq $key} btn-active{/if}" href="{:url('package/buyLogList', ['field'=>'state','value' => $key])}">{$v}</a>
                    {/volist}
                    {volist name="pay_types" id="v" }
                    <a class="btn btn-default btn-outline {if input('get.field/s') eq 'pay_type' && input('get.value/s') eq $key} btn-active{/if}" href="{:url('package/buyLogList', ['field'=>'pay_type','value' => $key])}">{$v}</a>
                    {/volist}

                    <form method="get" action="">
                        <div class="pull-left search">
                            <div class="columns columns-right btn-group pull-left">
                                <select class="form-control" name="search_field">
                                    <option value="b_l.order_sn" {if input('get.search_field') eq 'b_l.order_sn'}selected="selected"{/if}>订单号</option>
                                    <option value="m.id" {if input('get.search_field') eq 'm.id'}selected="selected"{/if}>用户ID</option>
                                    <option value="m.username" {if input('get.search_field') eq 'm.username'}selected="selected"{/if}>手机号</option>
                                    <option value="m.nickname" {if input('get.search_field') eq 'm.nickname'}selected="selected"{/if}>会员昵称</option>
                                </select>
                            </div>

                            <div class="pull-right search">
                                <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px"
                                        class="btn btn-default btn-outline" type="submit">搜索
                                </button>

                            </div>

                            <div class="columns columns-right btn-group search">
                                <input class="form-control input-outline" type="search_value" name="search_value" value="{:input('get.search_value', '')}" />
                            </div>


                            <div class="columns columns-right btn-group pull-right">
                                <input type="text" name="date_range" id="date_range" class="form-control" placeholder="购买时间"
                                       value="{if !empty($name.begin_date)}{$name.begin_date}{/if}{if !empty($name.end_date)} - {$name.end_date}{/if}" />
                            </div>

                        </div>
                    </form>

                </div>
                <div class="example">
                    <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                            <tr>
                                <th data-align="center">订单号</th>
                                <th data-align="center">会员id</th>
                                <th data-align="center">名称</th>
                                <th data-align="center">手机号</th>
                                <th data-align="center">付款方式</th>
                                <th data-align="center">支付状态</th>
                                <th data-align="center">支付金额</th>
                                <th data-align="center">备注</th>
                                <th data-align="center">类型</th>
                                <th data-align="center">有效期开始时间</th>
                                <th data-align="center">有效期截至时间</th>
                                <th data-align="center">购买时间</th>
                                <th data-align="center">管理</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr id="id{$vo.id}">
                                <td>{$vo.order_sn}</td>
                                <td>{$vo.member_id}</td>
                                <td>{$vo.nickname}<br/>{$m_types[$vo.m_type]}</td>
                                <td>{$vo.username}</td>
                                <td>{$pay_types[$vo.pay_type]}</td>
                                <td>{$states[$vo.state]}</td>
                                <td>{$vo.price}</td>
                                <td>{$vo.desc}</td>
                                <td>{$types[$vo.type]}</td>
                                <td>{$vo.expire_start_time|date='Y-m-d H:i:s'}</td>
                                <td>{$vo.expire_end_time|date='Y-m-d H:i:s'}</td>
                                <td>{$vo.create_time|date='Y-m-d H:i:s'}</td>
                                <td>
                                    <div class="btn-group">
                                        <div data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">
                                            操作 <span class="caret"></span>
                                        </div>
                                        <ul class="dropdown-menu">
                                            {if $vo.state==0}
                                            <li><a onclick="delById("package_buy_log",'{$vo.id}')">删除</a></li>
                                            {/if}
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>

            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page|raw}</div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table-zh-CN.min.js"}
<script type="text/javascript">
    function add(url) {
        layer.open({
            type: 2,
            title: '内容管理',
            shadeClose: false,
            shade: 0.2,
            area: ['80%', '95%'],
            skin: 'shangchuantup',
            // shift:-1,
            content: url,
        });
    }
    layui.use('laydate',function () {
        layui.laydate.render({
            elem: '#date_range',
            type: 'date',
            range: true
        });
    });

</script>